//
//  CelloneTab.m
//  project-A (pianke)
//
//  Created by dllo on 16/1/26.
//  Copyright © 2016年 scott. All rights reserved.
//

#import "CelloneTab.h"
#import <DKNightVersion.h>
@implementation CelloneTab


-(void)dealloc{
    [_zan release];
    [_labelLei release];
    [_labelneirong release];
    [_labelTitle release];
    [_image release];
    [_labelcount release];
   
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatview];
    }
    
    return self;
}

-(void)creatview{
    self.zan = [[UIImageView alloc]init];
        [self.contentView addSubview:self.zan];
    self.zan.image = [UIImage imageNamed:@"xin"];
    [self.zan release];
    
    self.image = [[UIImageView alloc]init];
    [self.contentView addSubview:self.image];
   
    [self.image release];
    
    self.labelLei = [[UILabel alloc]init];
    [self.contentView addSubview:self.labelLei];
    
    self.labelLei.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    
        [self.labelLei release];
    
    self.labelneirong = [[UILabel alloc]init];
    [self.contentView addSubview:self.labelneirong];

    self.labelneirong.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    
    [self.labelneirong release];
    
    self.labelTitle = [[UILabel alloc]init];
    [self.contentView addSubview:self.labelTitle];
    
    self.labelTitle.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    
    [self.labelTitle release];
    
    
    self.labelcount = [[UILabel alloc]init];
    [self.contentView addSubview:self.labelcount];
   
    self.labelcount.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    
    [self.labelcount release];
}

-(void)layoutSubviews{
    [super layoutSubviews];
    
    CGFloat width = self.contentView.frame.size.width;
//    CGFloat height = self.contentView.frame.size.height;
    
    self.labelLei.frame = CGRectMake(20, 20,width - 40     , 15);
    
   
    self.image.frame = CGRectMake(20,50, width - 40, (width - 40)/2 - 25);
    self.labelTitle.frame = CGRectMake(20, 40 + (width - 40)/2 ,width - 40, 20);
    self.labelneirong.frame = CGRectMake(20, 75 + (width - 40)/2, width - 40, 40);
    self.zan.frame = CGRectMake(width - 100 , 135 +(width - 40)/2 , 20, 20);
    self.labelcount.frame = CGRectMake(width - 70, 135 +(width - 40)/2,40, 20);
    
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
